#
class Solution:
    def isAnagram(self, s: str, t: str) -> bool:
        sl = list(s)
        tl = list(t)
        sl.sort()
        tl.sort()
        if sl == tl:
            return True
        else:
            return False

class Solution:
    def isAnagram(self, s: str, t: str) -> bool:
        s1 = sorted(s)
        t1 = sorted(t)
        if s1 == t1:
            return True
        else:
            return False

# 提高效率可以增加判断字符串长度是否相等


# hash表判断

class Solution:
    def isAnagram(self, s: str, t: str) -> bool:
        if len(s) != len(t):
            return False
        sdict = collections.defaultdict(lambda: 0)
        tdict = collections.defaultdict(lambda: 0)
        for v1 in s:
            sdict[v1] += 1
        for v2 in t:
            tdict[v2] += 1
        if sdict == tdict:
            return True
        else:
            return False
